package com.yanqu.road.server.cmd.activity.busyfarming;

import com.yanqu.road.pb.activity.BusyFarmingProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.busyfarming.CrossBusyFarmingMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_BUSY_FARMING_ACTIVITY_STEAL_SEARCH_DETAIL, desc = "偷菜查找-详情")
public class CrossStealSearchDetailCmd extends CrossCommand {

    int activityId;
    //查找的玩家
    long userId;
    //查找的区服
    long userServerId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BusyFarmingProto.CrossBusyFarmingStealHomeDetailReqMsg reqMsg = BusyFarmingProto.CrossBusyFarmingStealHomeDetailReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        userId = reqMsg.getUserId();
        userServerId = reqMsg.getServerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossBusyFarmingMgr.searchStealDetail(serverId, packet.getPlayerId(), activityId, userId, userServerId);
    }

    @Override
    public void sendData() {

    }
}
